#include "Strategy.h"

int StraInsStrategy::Sort(int arr[])
{
	cout << "Use Straight Insert Sort!"<<endl;
	return 0;
}

int SimpSelStrategy::Sort(int arr[])
{
	cout << "Use Simple Selection Sort!"<<endl;
	return 0;
}

int BubbStrategy::Sort(int arr[])
{
	cout << "Use Bubble Sort!"<<endl;
	return 0;
}


int Context::Sort(int arr[])
{
	if(_strategy)
	{
		return _strategy->Sort(arr);
	}

	return -1;
}


int main()
{
	int arr[] = { 6,2,8,9,5,7 };
	
	StraInsStrategy straInsStra;
	SimpSelStrategy simpSelStra;
	BubbStrategy bubbStra;
	
	Context context(&straInsStra);

	context.Sort(arr);

	context.SetStrategy(&simpSelStra);
	
	context.Sort(arr);

	context.SetStrategy(&bubbStra);
	
	context.Sort(arr);
	
	return 0;
}

